package org.theqcp.wow.sim.gui.tabs;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JPanel;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.border.TitledBorder;

import org.theqcp.wow.sim.gui.EnhSimGUIFrame;

public class RotationPriority extends JPanel {

    private static final long serialVersionUID = 4871807574926696316L;

    protected final String[] rotation = new String[] { "--- Inactive below this line ---", "SS", "ES", "LL", "MW5_LB",
	    "MW4_LB", "MW3_LB", "MW2_LB", "MW1_LB", "LB", "MW5_CL", "MW4_CL", "MW3_CL", "MW2_CL", "MW1_CL", "CL",
	    "LVB", "FS", "LS", "ST", "SR", "Frost" };

    protected final ReorderableJList listRotation;

    protected final Color listForeground, listBackground, listSelectionForeground, listSelectionBackground;

    public RotationPriority(EnhSimGUIFrame esgFrame) {
	setBorder(new TitledBorder("Rotation priority"));
	setLayout(new BorderLayout());
	listRotation = new ReorderableJList(rotation);

	UIDefaults uid = UIManager.getLookAndFeel().getDefaults();
	listForeground = uid.getColor("List.foreground");
	listBackground = uid.getColor("List.background");
	listSelectionForeground = uid.getColor("List.selectionForeground");
	listSelectionBackground = uid.getColor("List.selectionBackground");

	setMinimumSize(new Dimension(200, 400));
	setSize(getMinimumSize());

	setupFrame(esgFrame);
    }

    private void setupFrame( EnhSimGUIFrame esgFrame ) {
	add(listRotation, BorderLayout.CENTER);
    }

}
